package com.longnows.appserver.repository;

import com.longnows.appserver.model.Banner;
import com.longnows.appserver.model.Spu;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

//https://blog.csdn.net/weixin_43475992/article/details/129396294

public interface SpuRepository extends JpaRepository<Spu,Long> {

    Spu findOneById(Long id);

    Page<Spu> findByCategoryId(Long cid, Pageable page);
//    "select * from spu where category_id = cid"

    Page<Spu> findByRootCategoryId(Long cid, Pageable page);

}
